const http = require('http')
const path = require('path')
const fs = require('fs')

const app = http.createServer()

app.on('request',(req,res)=>{
  if(req.url === '/index.html'){
    fs.readFile(path.join(__dirname,'dist/index.html'),(err,data)=>{
      res.setHeader('Content-Type', 'text/html;charset=utf-8')
      res.end(data.toString())
    })
  }
})

app.listen(7001,()=>{
console.log('ok' ,'http://127.0.0.1:7001')

})